/* 
* Register.h
*
* Created: 10/27/2013 1:10:35 PM
* Author: brodzki
*/

#ifndef REGISTER_H_
#define REGISTER_H_

#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>

class Register
{
public:
	volatile uint8_t *address;

	Register() : address(0) {};
	
	Register(volatile uint8_t *val) : address(val) {}
		
	Register & operator=(volatile uint8_t *val)
	{
		address = val;
		return *this;
	}
	
	void set_bit(unsigned short int bit_no)
	{
		*address |= _BV(bit_no);
	}
	
	void unset_bit(unsigned short int bit_no)
	{
		*address &= ~_BV(bit_no);
	}
}; //Register

#endif // REGISTER_H_
